<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>e 账本 - 轻松记账...</title>
  </head>
  <body>
    <div id="menu" align = "right"
    <a href="{{ logout_url }}">{{logout_url_text}}</a>
    </div>
    Good Day, {{usernickname}},
    Please Add you today({{TODAY}})'s account.<br>
    <div id="income">
    <h2> Income </h2>
    <form action="/addincome" method="post" enctype="application/x-www-form-urlencoded">
      Where this income from? <br />
<input type = "radio" name = "incomesource" value = "salary" checked="yes" >Salary
<input type = "radio" name = "incomesource" value = "bonus" >Bonus
<input type = "radio" name = "incomesource" value = "parents" >Parents
<input type = "radio" name = "incomesource" value = "others" >Others<br />
How much money you got? <br>
<input type = "text" name = "amount" <br />
       Notes:<br>
       <textarea name = "notes" rows = "3" cols="60"></textarea> <br >
       <input type="submit" value="Add Income Record">
       <div id="expense" >
    </form>
    </div>
    <h2> Expense </h2>
    Your spend money ? <br>
    <form action="/addexpense" method="post">
      <div color="blue" > Money Spent to who ? <br /> </div>
      {% for who in expense_to_whom_table %}
      {% ifequal who "I" %}
      <input type = "radio" name = "expense_to_whom" value = "{{who}}" checked="yes"> {{who}}
      {% else %}
      <input type = "radio" name = "expense_to_whom" value = "{{who}}">{{who}}
      {% endifequal %}
      {% endfor %}
      <div color="blue"> Money belows to ? <br /> </div>
      {% for catelog in expense_catelog_table %}
      <input type = "radio" name = "expense_catelog" value = "{{catelog}}"> {{catelog}}
      {% endfor %}
      <div color = "blue"> Money is through ? <br /> </div>
      {% for through in expense_through_table %}
      {% ifequal through "Cash" %}
      <input type = "radio" name = "expense_through" value="{{through}}" checked="yes">{{through}}
      {% else %}
      <input type = "radio" name = "expense_through" value="{{through}}">{{through}}
      {% endifequal %}
      {% endfor %}

      <div color = "blue"> How much money you spend ?<br /> </div>
      <input type = "text" name = "amount"> <br />
      <div color="blue"> Notes: <br /></div>
      <textarea name = "notes" rows = "3" cols="60"></textarea> <br >
      <input type="submit" value="Add Expense Record">
      </div>
</form>
<div> Total Balance: <b>{{ TOTALMONEY }}<br></b></div><p>
<div align= "right" >
  {# Dump the records #}
{% for theq in querys %}
{% if theq.is_pay %}Expense: $<b>{{ theq.amount|escape}}</b> On {{theq.expense_catelog|escape}} through {{theq.expense_through|escape}} on {{theq.income_to_whom|escape}} @ {{theq.date.date}} Notes: {{theq.notes}}<br>
{% else %}
Income:$<b>{{ theq.amount|escape}}</b> From: {{theq.income_source|escape}} @ {{theq.date.date}} Notes: {{theq.notes}}<br>
{% endif %}
{% endfor %}
</div>
</body>
</html>
